package gui;

import javax.swing.GroupLayout;
import javax.swing.JLabel;
import javax.swing.LayoutStyle;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;

import core.CustomIcons;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class InitDBinfoWindow extends javax.swing.JFrame {
	private static InitDBinfoWindow instance = null;
	private JLabel logoLabel;
	private JLabel informationTextLabel;
	private JLabel thobberLabel;

	/**
	 * Auto-generated main method to display this JFrame
	 */
	public static void main(String [] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				InitDBinfoWindow inst = new InitDBinfoWindow();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}

	private InitDBinfoWindow() {
		super();
		this.setUndecorated(true);
		this.initGUI();
	}

	public static InitDBinfoWindow getInstance() {
		if (instance == null) {
			instance = new InitDBinfoWindow();
		}
		return instance;
	}

	private void initGUI() {
		try {
			GroupLayout thisLayout = new GroupLayout(this.getContentPane());
			this.getContentPane().setLayout(thisLayout);
			thisLayout.setVerticalGroup(thisLayout.createSequentialGroup().addContainerGap().addComponent(this.getLogoLabel(), 0, 357, Short.MAX_VALUE).addPreferredGap(
					LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE).addGroup(
					thisLayout.createParallelGroup().addComponent(this.getThobberLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE).addComponent(
							this.getInformationTextLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)).addContainerGap());
			thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup().addContainerGap().addGroup(
					thisLayout.createParallelGroup().addGroup(
							GroupLayout.Alignment.LEADING,
							thisLayout.createSequentialGroup().addComponent(this.getInformationTextLabel(), 0, 570, Short.MAX_VALUE).addGap(27).addComponent(this.getThobberLabel(),
									GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)).addComponent(this.getLogoLabel(), GroupLayout.Alignment.LEADING, 0, 619, Short.MAX_VALUE))
					.addContainerGap());
			this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.pack();
			this.setSize(643, 408);
		} catch (Exception e) {
			// add your error handling code here
			e.printStackTrace();
		}
	}

	private JLabel getLogoLabel() {
		if (this.logoLabel == null) {
			this.logoLabel = new JLabel();
			this.logoLabel.setIcon(CustomIcons.logoBig);
		}
		return this.logoLabel;
	}

	private JLabel getInformationTextLabel() {
		if (this.informationTextLabel == null) {
			this.informationTextLabel = new JLabel();
			this.informationTextLabel.setText("Datenbank wird initialisiert...");
		}
		return this.informationTextLabel;
	}

	private JLabel getThobberLabel() {
		if (this.thobberLabel == null) {
			this.thobberLabel = new JLabel();
			this.thobberLabel.setIcon(CustomIcons.throbber);
		}
		return this.thobberLabel;
	}

}
